
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3.7 客户端命令行操作 · 大数据 Zookeeper 课堂笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content=" 李振超">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-change_girls/girls.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="38-pei-zhi-can-shu-jie-du.html" />
    
    
    <link rel="prev" href="36fen-bu-shi-an-zhuang-bu-7f7228-fu-zhi-mo-shi-yun-xing-zookeeper.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.atguigu.com/" target="_blank" class="custom-link">联系我们</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    第 1 章 Zookeeper概述
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../1zookeepershi-shi-yao.html">
            
                <a href="../1zookeepershi-shi-yao.html">
            
                    
                    1.1 Zookeeper是什么
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="../2wei-shi-yao-xu-yao-zookeeper.html">
            
                <a href="../2wei-shi-yao-xu-yao-zookeeper.html">
            
                    
                    1.2 为什么需要Zookeeper
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="../3zookeeperying-yong-chang-jing.html">
            
                <a href="../3zookeeperying-yong-chang-jing.html">
            
                    
                    1.3 Zookeeper应用场景
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1.html">
            
                <a href="../chapter1.html">
            
                    
                    第 2 章 安装Zookeeper
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../chapter1/1xia-zai-he-an-zhuang-zookeeper.html">
            
                <a href="../chapter1/1xia-zai-he-an-zhuang-zookeeper.html">
            
                    
                    2.1 下载和安装Zookeeper
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../chapter1/2du-li-mo-shi-qi-dong-zookeeper.html">
            
                <a href="../chapter1/2du-li-mo-shi-qi-dong-zookeeper.html">
            
                    
                    2.2 独立模式操作Zookeeper
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../di-3-zhang-zookeep-shi-xian-yuan-li.html">
            
                <a href="../di-3-zhang-zookeep-shi-xian-yuan-li.html">
            
                    
                    第 3 章 Zookeep内部原理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="1shi-li-xu-qiu.html">
            
                <a href="1shi-li-xu-qiu.html">
            
                    
                    3.1 示例需求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="2zookeeperzhong-de-zu-cheng-yuan-guan-xi.html">
            
                <a href="2zookeeperzhong-de-zu-cheng-yuan-guan-xi.html">
            
                    
                    3.2 Zookeeper中组成员之间的关系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="3zookeepershu-ju-mo-xing.html">
            
                <a href="3zookeepershu-ju-mo-xing.html">
            
                    
                    3.3 Zookeeper数据模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="4zookeeperji-ben-cao-zuo.html">
            
                <a href="4zookeeperji-ben-cao-zuo.html">
            
                    
                    3.4 Zookeeper服务基本操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="5zookeepershi-xian-yuan-li.html">
            
                <a href="5zookeepershi-xian-yuan-li.html">
            
                    
                    3.5 Zookeeper实现原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="36fen-bu-shi-an-zhuang-bu-7f7228-fu-zhi-mo-shi-yun-xing-zookeeper.html">
            
                <a href="36fen-bu-shi-an-zhuang-bu-7f7228-fu-zhi-mo-shi-yun-xing-zookeeper.html">
            
                    
                    3.6 分布式安装部署(复制模式运行Zookeeper)
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3.7" data-path="37ke-hu-duan-ming-ling-xing-cao-zuo.html">
            
                <a href="37ke-hu-duan-ming-ling-xing-cao-zuo.html">
            
                    
                    3.7 客户端命令行操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="38-pei-zhi-can-shu-jie-du.html">
            
                <a href="38-pei-zhi-can-shu-jie-du.html">
            
                    
                    3.8 配置参数解读
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../di-4-zhang-zookeeper-shi-zhan.html">
            
                <a href="../di-4-zhang-zookeeper-shi-zhan.html">
            
                    
                    第 4 章 Zookeeper API使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../di-4-zhang-zookeeper-shi-zhan/41kai-fa-huan-jing-da-jian.html">
            
                <a href="../di-4-zhang-zookeeper-shi-zhan/41kai-fa-huan-jing-da-jian.html">
            
                    
                    4.1 开发环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../di-4-zhang-zookeeper-shi-zhan/42-chuang-jian-ke-hu-duan.html">
            
                <a href="../di-4-zhang-zookeeper-shi-zhan/42-chuang-jian-ke-hu-duan.html">
            
                    
                    4.2  创建客户端
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../di-4-zhang-zookeeper-shi-zhan/43chuang-jian-zi-jie-dian.html">
            
                <a href="../di-4-zhang-zookeeper-shi-zhan/43chuang-jian-zi-jie-dian.html">
            
                    
                    4.3 创建子节点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../di-4-zhang-zookeeper-shi-zhan/44huo-qu-zi-jie-dian-bing-jian-ting.html">
            
                <a href="../di-4-zhang-zookeeper-shi-zhan/44huo-qu-zi-jie-dian-bing-jian-ting.html">
            
                    
                    4.4 获取子节点并监听
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../di-4-zhang-zookeeper-shi-zhan/45-pan-duan-jie-dian-shi-fou-cun-zai.html">
            
                <a href="../di-4-zhang-zookeeper-shi-zhan/45-pan-duan-jie-dian-shi-fou-cun-zai.html">
            
                    
                    4.5  判断节点是否存在
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../di-4-zhang-zookeeper-shi-zhan/46-jian-ting-qi-yuan-li.html">
            
                <a href="../di-4-zhang-zookeeper-shi-zhan/46-jian-ting-qi-yuan-li.html">
            
                    
                    4.6 监听器原理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../di-5-zhang-an-li-shi-zhan.html">
            
                <a href="../di-5-zhang-an-li-shi-zhan.html">
            
                    
                    第 5 章 案例实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../di-5-zhang-an-li-shi-zhan/51-xu-qiu-fen-xi.html">
            
                <a href="../di-5-zhang-an-li-shi-zhan/51-xu-qiu-fen-xi.html">
            
                    
                    5.1 案例1:监听服务器动态上下线
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >3.7 客户端命令行操作</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="37-&#x5BA2;&#x6237;&#x7AEF;&#x547D;&#x4EE4;&#x884C;&#x64CD;&#x4F5C;">3.7 &#x5BA2;&#x6237;&#x7AEF;&#x547D;&#x4EE4;&#x884C;&#x64CD;&#x4F5C;</h1>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x5BA2;&#x6237;&#x7AEF;&#x53BB;&#x64CD;&#x4F5C; <code>znode</code>. (&#x5176;&#x5B9E;&#x5C31;&#x662F;&#x8FDC;&#x7A0B;&#x64CD;&#x4F5C; <code>Zookeeper Server</code>)</p>
<blockquote>
<h4 id="&#x6CE8;&#x610F;"><em>&#x6CE8;&#x610F;:</em></h4>
</blockquote>
<ul>
<li><code>znode</code>&#x90FD;&#x662F;&#x5B58;&#x50A8;&#x5728; Zookeeper &#x670D;&#x52A1;&#x5668;&#x4E0A;&#x7684;.</li>
</ul>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539653705.png" alt=""></p>
<hr>
<h2 id="1-&#x542F;&#x52A8;&#x5BA2;&#x6237;&#x7AEF;&#x5E76;&#x8FDE;&#x63A5;&#x5230;-zookeeper-&#x670D;&#x52A1;&#x5668;">1. &#x542F;&#x52A8;&#x5BA2;&#x6237;&#x7AEF;&#x5E76;&#x8FDE;&#x63A5;&#x5230; Zookeeper &#x670D;&#x52A1;&#x5668;</h2>
<pre class="language-"><code class="lang-bash">zkCli.sh   <span class="token comment"># &#x9ED8;&#x8BA4;&#x8FDE;&#x63A5;&#x5230;&#x5F53;&#x524D;&#x7684;Zookeeper&#x670D;&#x52A1;&#x5668;</span>

<span class="token comment"># zkCli.sh -server hadoop201:2181 # &#x8FDE;&#x63A5;&#x5230;&#x6307;&#x5B9A;&#x7684;Zookeeper&#x670D;&#x52A1;&#x5668;</span>
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539654121.png" alt=""></p>
<hr>
<h2 id="2-&#x663E;&#x793A;&#x6240;&#x6709;&#x64CD;&#x4F5C;&#x547D;&#x4EE4;">2. &#x663E;&#x793A;&#x6240;&#x6709;&#x64CD;&#x4F5C;&#x547D;&#x4EE4;</h2>
<pre class="language-"><code class="lang-bash"><span class="token function">help</span>
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539654362.png" alt=""></p>
<hr>
<h2 id="3-&#x67E5;&#x770B;&#x6839;znode&#x4E2D;&#x6240;&#x5305;&#x542B;&#x7684;&#x5185;&#x5BB9;">3. &#x67E5;&#x770B;&#x6839;<code>znode</code>&#x4E2D;&#x6240;&#x5305;&#x542B;&#x7684;&#x5185;&#x5BB9;</h2>
<pre class="language-"><code class="lang-bash"><span class="token function">ls</span> /
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539654974.png" alt=""></p>
<hr>
<h2 id="4-&#x67E5;&#x770B;&#x6839;znode&#x4E2D;&#x8282;&#x70B9;&#x6570;&#x636E;&#x66F4;&#x65B0;&#x6B21;&#x6570;&#x7B49;&#x6570;&#x636E;">4. &#x67E5;&#x770B;&#x6839;<code>znode</code>&#x4E2D;&#x8282;&#x70B9;&#x6570;&#x636E;&#x66F4;&#x65B0;&#x6B21;&#x6570;&#x7B49;&#x6570;&#x636E;</h2>
<pre class="language-"><code class="lang-bash">ls2 /
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539655221.png" alt=""></p>
<blockquote>
<p><code>stat</code>&#x7ED3;&#x6784;&#x8BF4;&#x660E;:
cZxid&#xFF1A;&#x8FD9;&#x662F;&#x5BFC;&#x81F4;&#x521B;&#x5EFA;znode&#x66F4;&#x6539;&#x7684;&#x4E8B;&#x52A1;ID&#x3002;
mZxid&#xFF1A;&#x8FD9;&#x662F;&#x6700;&#x540E;&#x4FEE;&#x6539;znode&#x66F4;&#x6539;&#x7684;&#x4E8B;&#x52A1;ID&#x3002;
pZxid&#xFF1A;&#x8FD9;&#x662F;&#x7528;&#x4E8E;&#x6DFB;&#x52A0;&#x6216;&#x5220;&#x9664;&#x5B50;&#x8282;&#x70B9;&#x7684;znode&#x66F4;&#x6539;&#x7684;&#x4E8B;&#x52A1;ID&#x3002;
ctime&#xFF1A;&#x8868;&#x793A;&#x4ECE;1970-01-01T00:00:00Z&#x5F00;&#x59CB;&#x4EE5;&#x6BEB;&#x79D2;&#x4E3A;&#x5355;&#x4F4D;&#x7684;znode&#x521B;&#x5EFA;&#x65F6;&#x95F4;&#x3002;
mtime&#xFF1A;&#x8868;&#x793A;&#x4ECE;1970-01-01T00:00:00Z&#x5F00;&#x59CB;&#x4EE5;&#x6BEB;&#x79D2;&#x4E3A;&#x5355;&#x4F4D;&#x7684;znode&#x6700;&#x8FD1;&#x4FEE;&#x6539;&#x65F6;&#x95F4;&#x3002;
dataVersion&#xFF1A;&#x8868;&#x793A;&#x5BF9;&#x8BE5;znode&#x7684;&#x6570;&#x636E;&#x6240;&#x505A;&#x7684;&#x66F4;&#x6539;&#x6B21;&#x6570;&#x3002;
cversion&#xFF1A;&#x8FD9;&#x8868;&#x793A;&#x5BF9;&#x6B64;znode&#x7684;&#x5B50;&#x8282;&#x70B9;&#x8FDB;&#x884C;&#x7684;&#x66F4;&#x6539;&#x6B21;&#x6570;&#x3002;
aclVersion&#xFF1A;&#x8868;&#x793A;&#x5BF9;&#x6B64;znode&#x7684;ACL&#x8FDB;&#x884C;&#x66F4;&#x6539;&#x7684;&#x6B21;&#x6570;&#x3002;
ephemeralOwner&#xFF1A;&#x5982;&#x679C;znode&#x662F;ephemeral&#x7C7B;&#x578B;&#x8282;&#x70B9;&#xFF0C;&#x5219;&#x8FD9;&#x662F;znode&#x6240;&#x6709;&#x8005;&#x7684; session ID&#x3002; &#x5982;&#x679C;znode&#x4E0D;&#x662F;ephemeral&#x8282;&#x70B9;&#xFF0C;&#x5219;&#x8BE5;&#x5B57;&#x6BB5;&#x8BBE;&#x7F6E;&#x4E3A;&#x96F6;&#x3002;
dataLength&#xFF1A;&#x8FD9;&#x662F;znode&#x6570;&#x636E;&#x5B57;&#x6BB5;&#x7684;&#x957F;&#x5EA6;&#x3002;
numChildren&#xFF1A;&#x8FD9;&#x8868;&#x793A;znode&#x7684;&#x5B50;&#x8282;&#x70B9;&#x7684;&#x6570;&#x91CF;&#x3002;</p>
</blockquote>
<hr>
<h2 id="5-&#x521B;&#x5EFA;&#x666E;&#x901A;&#x8282;&#x70B9;&#x6301;&#x4E45;&#x8282;&#x70B9;">5. &#x521B;&#x5EFA;&#x666E;&#x901A;&#x8282;&#x70B9;(&#x6301;&#x4E45;&#x8282;&#x70B9;)</h2>
<pre class="language-"><code class="lang-bash">creat /app1 <span class="token string">&quot;hello app1&quot;</span>
</code></pre>
<blockquote>
<h4 id="&#x8BF4;&#x660E;"><em>&#x8BF4;&#x660E;:</em></h4>
<ul>
<li><code>app1</code>&#x662F;&#x8282;&#x70B9;&#x540D;</li>
<li><code>hello app1</code>&#x662F;&#x8FD9;&#x4E2A;&#x8282;&#x70B9;&#x4E2D;&#x5B58;&#x50A8;&#x7684;&#x6570;&#x636E;(&#x4E0A;&#x9650;&#x5927;&#x5C0F;&#x662F;<code>1M</code>)</li>
</ul>
</blockquote>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539657449.png" alt=""></p>
<pre class="language-"><code class="lang-bash">create /app1/server201 <span class="token string">&quot;192.168.1.201&quot;</span>
</code></pre>
<hr>
<h2 id="6-&#x83B7;&#x5F97;&#x8282;&#x70B9;&#x7684;&#x503C;">6. &#x83B7;&#x5F97;&#x8282;&#x70B9;&#x7684;&#x503C;</h2>
<pre class="language-"><code class="lang-bash">get /app1
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539657724.png" alt=""></p>
<hr>
<h2 id="7-&#x521B;&#x5EFA;&#x77ED;&#x6682;&#x8282;&#x70B9;">7. &#x521B;&#x5EFA;&#x77ED;&#x6682;&#x8282;&#x70B9;</h2>
<pre class="language-"><code class="lang-bash">create -e /app-temp <span class="token string">&quot;temp data ....&quot;</span>
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539658485.png" alt=""></p>
<blockquote>
<h4 id="&#x6CE8;&#x610F;"><em>&#x6CE8;&#x610F;:</em></h4>
</blockquote>
<ul>
<li>&#x53EA;&#x8981;&#x521B;&#x5EFA;&#x4E34;&#x65F6;&#x8282;&#x70B9;&#x7684;&#x4F1A;&#x8BDD;(session)&#x6CA1;&#x6709;&#x5173;&#x95ED;, &#x4E0D;&#x4EC5;&#x4EC5;&#x5F53;&#x524D;&#x5BA2;&#x6237;&#x7AEF;&#x53EF;&#x4EE5;&#x770B;&#x8BBF;&#x95EE;&#x5230;&#x4E34;&#x65F6;&#x8282;&#x70B9;, &#x4F7F;&#x7528;&#x5176;&#x4ED6;&#x5BA2;&#x6237;&#x7AEF;&#x4E5F;&#x662F;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x8FD9;&#x4E2A;&#x4E34;&#x65F6;&#x8282;&#x70B9;.</li>
<li>&#x4E34;&#x65F6;&#x8282;&#x70B9;&#x4E0D;&#x80FD;&#x6709;&#x5B50;&#x8282;&#x70B9;
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539658687.png" alt=""></li>
<li>&#x5173;&#x95ED;&#x4F1A;&#x8BDD;&#x4E4B;&#x540E;, &#x4E34;&#x65F6;&#x8282;&#x70B9;&#x81EA;&#x52A8;&#x88AB;&#x5220;&#x9664;
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539658781.png" alt=""></li>
</ul>
<hr>
<h2 id="8-&#x521B;&#x5EFA;&#x5E26;&#x5E8F;&#x53F7;&#x7684;&#x8282;&#x70B9;">8. &#x521B;&#x5EFA;&#x5E26;&#x5E8F;&#x53F7;&#x7684;&#x8282;&#x70B9;</h2>
<ul>
<li>&#x5148;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x6BD4;&#x666E;&#x901A;&#x8282;&#x70B9; <code>app2</code><pre class="language-"><code class="lang-bash">create /app2 <span class="token string">&quot;my name is app2&quot;</span>
</code></pre>
</li>
<li>&#x5728;<code>app2</code>&#x5185;&#x521B;&#x5EFA;&#x5E26;&#x5E8F;&#x53F7;&#x7684;&#x8282;&#x70B9;<pre class="language-"><code class="lang-bash">create -s /app2/aa <span class="token string">&quot;123455679&quot;</span>
</code></pre>
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539659633.png" alt=""></li>
</ul>
<blockquote>
<h4 id="&#x8BF4;&#x660E;"><em>&#x8BF4;&#x660E;:</em></h4>
</blockquote>
<ul>
<li>&#x6CA1;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x5E26;&#x5E8F;&#x53F7;&#x7684;&#x8282;&#x70B9;, &#x5E8F;&#x53F7;&#x90FD;&#x4F1A;&#x81EA;&#x589E;1.<br><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539659735.png" alt=""></li>
<li><p>&#x5E8F;&#x53F7;&#x7684;&#x542B;&#x4E49;&#x8868;&#x793A;&#x8FD9;&#x4E2A;&#x5E26;&#x5E8F;&#x53F7;&#x7684;&#x8282;&#x70B9;&#x662F;&#x4ED6;&#x7236;&#x8282;&#x70B9;&#x7684;&#x7B2C;&#x51E0;&#x4E2A;&#x8282;&#x70B9;.  </p>
<p>&#x521B;&#x5EFA;<code>/app3</code>, <code>/app3/a</code>, <code>-e /app3/b</code><br>&#x7136;&#x540E;&#x521B;&#x5EFA;<code>-s /app3/cc</code>, &#x5219;&#x5E8F;&#x53F7;&#x4ECE;<code>2</code>&#x5F00;&#x59CB;.
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539660050.png" alt=""></p>
</li>
</ul>
<hr>
<h2 id="9-&#x4FEE;&#x6539;&#x8282;&#x70B9;&#x4E2D;&#x5B58;&#x50A8;&#x7684;&#x6570;&#x636E;">9. &#x4FEE;&#x6539;&#x8282;&#x70B9;&#x4E2D;&#x5B58;&#x50A8;&#x7684;&#x6570;&#x636E;</h2>
<pre class="language-"><code class="lang-bash"><span class="token keyword">set</span> /app1 <span class="token string">&quot;new data&quot;</span>
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539660765.png" alt=""></p>
<h2 id="10-&#x76D1;&#x542C;&#x8282;&#x70B9;&#x4E2D;&#x6570;&#x636E;&#x7684;&#x53D8;&#x5316;">10. &#x76D1;&#x542C;&#x8282;&#x70B9;&#x4E2D;&#x6570;&#x636E;&#x7684;&#x53D8;&#x5316;</h2>
<ul>
<li><p>&#x5728;<code>201</code>&#x4E3B;&#x673A;&#x4E0A;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x76D1;&#x542C;:</p>
<pre class="language-"><code class="lang-bash">get /app1 <span class="token function">watch</span>
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539661074.png" alt=""></p>
</li>
<li><p>&#x5728;<code>203</code>&#x4E3B;&#x673A;&#x4E0A;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x4FEE;&#x6539;&#x6570;&#x636E;
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539661146.png" alt=""></p>
</li>
<li><p>&#x5728;<code>201</code>&#x4E3B;&#x673A;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x6536;&#x5230;&#x7684;&#x6570;&#x636E;&#x53D8;&#x5316;&#x7684;&#x901A;&#x77E5;
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539661229.png" alt=""></p>
</li>
</ul>
<hr>
<h2 id="11-&#x76D1;&#x542C;&#x8282;&#x70B9;&#x7ED3;&#x6784;&#x7684;&#x53D8;&#x5316;">11. &#x76D1;&#x542C;&#x8282;&#x70B9;&#x7ED3;&#x6784;&#x7684;&#x53D8;&#x5316;</h2>
<ul>
<li>&#x5728;<code>201</code>&#x4E3B;&#x673A;&#x4E0A;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x76D1;&#x542C;:<pre class="language-"><code class="lang-bash"><span class="token function">ls</span> /app1 <span class="token function">watch</span>
</code></pre>
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539661467.png" alt=""></li>
</ul>
<ul>
<li>&#x5728;<code>203</code>&#x4E3B;&#x673A;&#x4E0A;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x7ED9;<code>/app1</code>&#x6DFB;&#x52A0;&#x65B0;&#x7684;&#x8282;&#x70B9;
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539661549.png" alt=""></li>
</ul>
<ul>
<li>&#x5728;<code>201</code>&#x4E3B;&#x673A;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x6536;&#x5230;&#x7684;&#x6570;&#x636E;&#x53D8;&#x5316;&#x7684;&#x901A;&#x77E5;
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539661579.png" alt=""></li>
</ul>
<hr>
<h2 id="12-&#x5220;&#x9664;&#x7A7A;&#x8282;&#x70B9;">12. &#x5220;&#x9664;&#x7A7A;&#x8282;&#x70B9;</h2>
<pre class="language-"><code class="lang-bash">delete /app1/server201
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539661772.png" alt=""></p>
<blockquote>
<h4 id="&#x6CE8;&#x610F;"><em>&#x6CE8;&#x610F;:</em></h4>
</blockquote>
<ul>
<li><p><code>delte</code>&#x53EA;&#x80FD;&#x5220;&#x9664;&#x7A7A;&#x8282;&#x70B9;(&#x6CA1;&#x6709;&#x5B50;&#x8282;&#x70B9;&#x7684;&#x8282;&#x70B9;)</p>
</li>
<li><p>&#x4E0D;&#x80FD;&#x5220;&#x9664;&#x975E;&#x7A7A;&#x8282;&#x70B9;
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539661912.png" alt=""></p>
</li>
</ul>
<hr>
<h2 id="13-&#x9012;&#x5F52;&#x7684;&#x5220;&#x9664;&#x8282;&#x70B9;">13. &#x9012;&#x5F52;&#x7684;&#x5220;&#x9664;&#x8282;&#x70B9;</h2>
<p>&#x9012;&#x5F52;&#x7684;&#x65B9;&#x5F0F;&#x5220;&#x9664;&#x8282;&#x70B9;, &#x7A7A;&#x8282;&#x70B9;&#x548C;&#x975E;&#x7A7A;&#x8282;&#x70B9;&#x90FD;&#x53EF;&#x4EE5;&#x5220;&#x9664;.</p>
<pre class="language-"><code class="lang-bash">rmr /app1
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539669550.png" alt=""></p>
<hr>
<h2 id="14-&#x67E5;&#x770B;&#x67D0;&#x4E2A;&#x8282;&#x70B9;&#x7684;&#x72B6;&#x6001;">14. &#x67E5;&#x770B;&#x67D0;&#x4E2A;&#x8282;&#x70B9;&#x7684;&#x72B6;&#x6001;</h2>
<pre class="language-"><code class="lang-bash"><span class="token function">stat</span> /app2
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1539669694.png" alt=""></p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x5C1A;&#x7845;&#x8C37;&#x5927;&#x6570;&#x636E; &amp; 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><br>&#x8BE5;&#x6587;&#x4EF6;&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-10-18 11:15:50
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="36fen-bu-shi-an-zhuang-bu-7f7228-fu-zhi-mo-shi-yun-xing-zookeeper.html" class="navigation navigation-prev " aria-label="Previous page: 3.6 分布式安装部署(复制模式运行Zookeeper)">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="38-pei-zhi-can-shu-jie-du.html" class="navigation navigation-next " aria-label="Next page: 3.8 配置参数解读">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"3.7 客户端命令行操作","level":"1.3.7","depth":2,"next":{"title":"3.8 配置参数解读","level":"1.3.8","depth":2,"path":"di-3-zhang-zookeep-shi-xian-yuan-li/38-pei-zhi-can-shu-jie-du.md","ref":"di-3-zhang-zookeep-shi-xian-yuan-li/38-pei-zhi-can-shu-jie-du.md","articles":[]},"previous":{"title":"3.6 分布式安装部署(复制模式运行Zookeeper)","level":"1.3.6","depth":2,"path":"di-3-zhang-zookeep-shi-xian-yuan-li/36fen-bu-shi-an-zhuang-bu-7f7228-fu-zhi-mo-shi-yun-xing-zookeeper.md","ref":"di-3-zhang-zookeep-shi-xian-yuan-li/36fen-bu-shi-an-zhuang-bu-7f7228-fu-zhi-mo-shi-yun-xing-zookeeper.md","articles":[]},"dir":"ltr"},"config":{"plugins":["splitter","expandable-chapters-small","page-toc-button","-highlight","prism","prism-themes","tbfed-pagefooter","sitemap","change_girls","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 尚硅谷大数据 & 2019","modify_label":"<br>该文件最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"disqus":{"shortName":"zhenchao125"},"livereload":{},"splitter":{},"change_girls":{"time":30,"urls":["http://o7cqr8cfk.bkt.clouddn.com/18-3-4/62171757.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/83394736.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/15906185.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/15906185.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/3394270.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/65028582.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/20359261.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/37472401.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/3355397.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/11075549.jpg-atguiguImg"]},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sitemap":{"hostname":"https://www.gitbook.com/@zhenchao125"},"page-toc-button":{"maxTocDepth":3,"minTocSize":2},"prism-themes":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":" 李振超","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"大数据 Zookeeper 课堂笔记","language":"zh-hans","links":{"sidebar":{"联系我们":"http://www.atguigu.com/"}},"gitbook":"*","description":"课堂笔记,学生提前预习"},"file":{"path":"di-3-zhang-zookeep-shi-xian-yuan-li/37ke-hu-duan-ming-ling-xing-cao-zuo.md","mtime":"2018-10-18T03:15:50.979Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-11-11T09:39:20.722Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-change_girls/girls.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

